<#include "/common/head2.html"/> 
<div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
	<form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
		<table>
			<tr>
				<td>
					<span class="adertisement">充值方式：</span>
					<select class="easyui-combobox" id="type" name="type" >
		 		  	    <option value ="0">现金</option>
	                    <option value ="1">刷卡</option>
		 		  	    <option value ="2">支付宝</option>
	                    <option value ="3">微信</option>
				    </select>
				</td>
			</tr>
		
			<tr>
				<td>
					<span class="adertisement">充值金额：</span>
					<input required="true" class="easyui-validatebox" type="text" id="balance" name="balance" value="${shop.balance!''}"></input>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">充值时间：</span>
					<input required="true" class="easyui-validatebox" type="text" id="createTime" readonly="readonly" name="createTime" value="${shop.createTime!''}"></input>
					<!-- 获取shopid -->
					<input type="hidden" value="${shop.id!''}" id="shopId">
				   	<input type="hidden" value="${shop.searchNumber!''}" id="searchNumber"></input>
					<input type="hidden" value="${shop.balance!''}" id="balance"></input>
  	 				<input type="hidden" value="${shop.name!''}" id="name"></input>
				</td>
			</tr>
			
			<tr>
            	<td>
	            	<div data-options="region:'south',border:false" style="text-align: right; padding: 12px; border-top-width: 0px; border-top-style: solid; border-top-color: rgb(221, 221, 221); width: 674px; height: 28px;" title="" class="panel-body panel-body-noheader panel-body-noborder layout-body">
	            		<a class="easyui-linkbutton color1 l-btn l-btn-small" href="javascript:void(0)" onclick="javascript:save();" style="width: 220px;">
	            			<span class="l-btn-center" style="margin-top: 0px;"><span class="l-btn-text">确定</span></span>
	            		</a>
	        		</div>
            	</td>
            </tr>				
		</table>
	</form>
</div>
<script type="text/javascript">
var shopId=$("#shopId").val();
var searchNumber=$("#searchNumber").val();
var balance=$("#balance").val();
var name=$("#name").val();
var username=$("#username").val();
function save() {
	$("#ff").form('submit', { 
        url: "updatePage?id="+shopId, 
        onSubmit: function () {   
        	//表单提交前的回调函数 
        	if(!$("#ff").form('enableValidation').form('validate')) {
            	$.messager.alert('操作结果','请检查标红输入项','error');
        		return false;
        	}       	
        	
        }, 
        success: function (v) {
        	var v = eval('('+v+')');
        	var result = v.result;
        	if(result =='success'){
    	        	$.messager.alert('操作结果','修改成功！','info',function(){location.replace("recharge?id="+shopId+"&name="+name+"&balance="+balance+"&searchNumber="+searchNumber+"&username="+username)});
    	        
        	}else{
    	        	$.messager.alert('操作结果','修改失败','error');
        	}
    	}
      }); 
}
</script>
<#include "/common/dialogWindow.html"/>
<#include "/common/foot.html"/>